using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._3DAnalystTools._Raster._Interpolation
{
    /// <summary>
    /// <para>IDW</para>
    /// <para>Interpolates a raster surface from points using an inverse distance weighted (IDW) technique.</para>
    /// <para>使用反距离加权 （IDW） 技术从点插值栅格表面。</para>
    /// </summary>    
    [DisplayName("IDW")]
    public class Idw : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public Idw()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_point_features">
        /// <para>Input point features</para>
        /// <para>The input point features containing the z-values to be interpolated into a surface raster.</para>
        /// <para>包含要插值到表面栅格中的 z 值的输入点要素。</para>
        /// </param>
        /// <param name="_z_field">
        /// <para>Z value field</para>
        /// <para><xdoc>
        ///   <para>The field that holds a height or magnitude value for each point.</para>
        ///   <para>This can be a numeric field or the Shape field if the input point features contain z-values.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>保存每个点的高度或大小值的字段。</para>
        ///   <para>这可以是数值字段，也可以是形状字段（如果输入点要素包含 z 值）。</para>
        /// </xdoc></para>
        /// </param>
        /// <param name="_out_raster">
        /// <para>Output raster</para>
        /// <para><xdoc>
        ///   <para>The output interpolated surface raster.</para>
        ///   <para>It is always a floating-point raster.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输出插值表面栅格。</para>
        ///   <para>它始终是浮点栅格。</para>
        /// </xdoc></para>
        /// </param>
        public Idw(object _in_point_features, object _z_field, object _out_raster)
        {
            this._in_point_features = _in_point_features;
            this._z_field = _z_field;
            this._out_raster = _out_raster;
        }
        public override string ToolboxName => "3D Analyst Tools";

        public override string ToolName => "IDW";

        public override string CallName => "3d.Idw";

        public override List<string> AcceptEnvironments => ["autoCommit", "cellSize", "cellSizeProjectionMethod", "configKeyword", "extent", "geographicTransformations", "mask", "outputCoordinateSystem", "scratchWorkspace", "snapRaster", "tileSize", "workspace"];

        public override object[] ParameterInfo => [_in_point_features, _z_field, _out_raster, _cell_size, _power, _search_radius, _in_barrier_polyline_features];

        /// <summary>
        /// <para>Input point features</para>
        /// <para>The input point features containing the z-values to be interpolated into a surface raster.</para>
        /// <para>包含要插值到表面栅格中的 z 值的输入点要素。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input point features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_point_features { get; set; }


        /// <summary>
        /// <para>Z value field</para>
        /// <para><xdoc>
        ///   <para>The field that holds a height or magnitude value for each point.</para>
        ///   <para>This can be a numeric field or the Shape field if the input point features contain z-values.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>保存每个点的高度或大小值的字段。</para>
        ///   <para>这可以是数值字段，也可以是形状字段（如果输入点要素包含 z 值）。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Z value field")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _z_field { get; set; }


        /// <summary>
        /// <para>Output raster</para>
        /// <para><xdoc>
        ///   <para>The output interpolated surface raster.</para>
        ///   <para>It is always a floating-point raster.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输出插值表面栅格。</para>
        ///   <para>它始终是浮点栅格。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output raster")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_raster { get; set; }


        /// <summary>
        /// <para>Output cell size</para>
        /// <para><xdoc>
        ///   <para>The cell size of the output raster that will be created.</para>
        ///   <para>This parameter can be defined by a numeric value or obtained from an existing raster dataset. If the cell size hasn't been explicitly specified as the parameter value, the environment cell size value will be used if specified; otherwise, additional rules will be used to calculate it from the other inputs. See the usage section for more detail.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>将创建的输出栅格的像元大小。</para>
        ///   <para>此参数可以由数值定义，也可以从现有栅格数据集中获取。如果尚未将像元大小显式指定为参数值，则在指定的情况下将使用环境像元大小值;否则，将使用其他规则从其他输入计算它。有关详细信息，请参阅用法部分。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output cell size")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _cell_size { get; set; } = null;


        /// <summary>
        /// <para>Power</para>
        /// <para><xdoc>
        ///   <para>The exponent of distance.</para>
        ///   <para>Controls the significance of surrounding points on the interpolated value. A higher power results in less influence from distant points. It can be any real number greater than 0, but the most reasonable results will be obtained using values from 0.5 to 3. The default is 2.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>距离的指数。</para>
        ///   <para>控制周围点对插值的重要性。功率越高，来自远处的影响越小。它可以是任何大于 0 的实数，但使用 0.5 到 3 的值将获得最合理的结果。默认值为 2。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Power")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public double _power { get; set; } = 2;


        /// <summary>
        /// <para>Search radius</para>
        /// <para><xdoc>
        ///   <para>Defines which of the input points will be used to interpolate the value for each cell in the output raster.</para>
        ///   <para>There are two options: Variable and Fixed. Variable is the default.</para>
        ///   <bulletList>
        ///     <bullet_item>Variable
        ///     <para>Uses a variable search radius in order to find a specified number of input sample points for the interpolation.</para>
        ///     <bulletList>
        ///       <bullet_item>Number of points—An integer value specifying the number of nearest input sample points to be used to perform interpolation. The default is 12 points.  </bullet_item><para/>
        ///       <bullet_item>Maximum distance—Specifies the distance, in map units, by which to limit the search for the nearest input sample points. The default value is the length of the extent's diagonal.  </bullet_item><para/>
        ///     </bulletList>
        ///     </bullet_item><para/>
        ///   </bulletList>
        ///   <bulletList>
        ///     <bullet_item>Fixed
        ///     <para>Uses a specified fixed distance within which all input points will be used for the interpolation.</para>
        ///     <bulletList>
        ///       <bullet_item>Distance—Specifies the distance as a radius within which input sample points will be used to perform the interpolation.
        ///         <para>The value of the radius is expressed in map units. The default radius is five times the cell size of the output raster.    </para>
        ///       </bullet_item><para/>
        ///       <bullet_item>Minimum number of points—An integer defining the minimum number of points to be used for interpolation. The default value is 0.
        ///         <para>If the required number of points is not found within the specified distance, the search distance will be increased until the specified minimum number of points is found.    </para>
        ///         <para>When the search radius needs to be increased it is done so until the Minimum number of points fall within that radius, or the extent of the radius crosses the lower (southern) and/or upper (northern) extent of the output raster. NoData is assigned to all locations that do not satisfy the above condition.    </para>
        ///       </bullet_item><para/>
        ///     </bulletList>
        ///     </bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>定义将使用哪些输入点对输出栅格中每个像元的值进行插值。</para>
        ///   <para>有两个选项：“可变”和“固定”。变量是默认值。</para>
        ///   <bulletList>
        /// <bullet_item>变量
        ///     <para>使用可变搜索半径来查找指定数量的插值输入采样点。</para>
        ///     <bulletList>
        ///       <bullet_item>点数 - 一个整数值，指定用于执行插值的最近输入采样点数。默认值为 12 磅。 </bullet_item><para/>
        ///       <bullet_item>最大距离 - 指定距离（以地图单位表示），用于限制对最近输入采样点的搜索。默认值为范围对角线的长度。 </bullet_item><para/>
        ///     </bulletList>
        ///     </bullet_item><para/>
        ///   </bulletList>
        ///   <bulletList>
        /// <bullet_item>固定
        ///     <para>使用指定的固定距离，在该距离内，所有输入点都将用于插值。</para>
        ///     <bulletList>
        /// <bullet_item>距离 （Distance） - 将距离指定为半径，在该半径范围内，输入采样点将用于执行插值。
        ///         <para>半径的值以地图单位表示。默认半径为输出栅格像元大小的 5 倍。   </para>
        ///       </bullet_item><para/>
        /// <bullet_item>最小点数 （Minimum number of Points） - 定义用于插值的最小点数的整数。默认值为 0。
        ///         <para>如果在指定距离内未找到所需的点数，则搜索距离将增加，直到找到指定的最小点数。</para>
        ///         <para>当需要增加搜索半径时，将执行此操作，直到最小点数落在该半径内，或者半径范围与输出栅格的下部（南部）和/或上限（北部）范围相交。NoData 将分配给不满足上述条件的所有位置。   </para>
        ///       </bullet_item><para/>
        ///     </bulletList>
        ///     </bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Search radius")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _search_radius { get; set; } = null;


        /// <summary>
        /// <para>Input barrier polyline features</para>
        /// <para>Polyline features to be used as a break or limit in searching for the input sample points.</para>
        /// <para>折线特征在搜索输入采样点时用作中断或限制。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input barrier polyline features")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _in_barrier_polyline_features { get; set; } = null;


        public Idw SetEnv(int? autoCommit = null, object cellSize = null, object configKeyword = null, object extent = null, object geographicTransformations = null, object mask = null, object outputCoordinateSystem = null, object scratchWorkspace = null, object snapRaster = null, double[] tileSize = null, object workspace = null)
        {
            base.SetEnv(autoCommit: autoCommit, cellSize: cellSize, configKeyword: configKeyword, extent: extent, geographicTransformations: geographicTransformations, mask: mask, outputCoordinateSystem: outputCoordinateSystem, scratchWorkspace: scratchWorkspace, snapRaster: snapRaster, tileSize: tileSize, workspace: workspace);
            return this;
        }

    }

}